<?php

/**
 *      [CodeJm!] Author CodeJm[codejm@163.com].
 *
 *      
 *      $Id: Itemscategory.php 2016-03-31 15:42:44 codejm $
 */

class ItemscategoryModel extends \Core_CMode {

    public $_table = '`yaf_items_category`';

    /**
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels() {
        return array(
            'ic_id' => '物品分类id', 
            'ic_name' => '物品分类名称', 
            'addtime' => '添加时间',
        );
    }

    /**
     * 楠岃瘉瑙勫垯
     *
     */
    public function rules() {
        return array(
            'default'=> array(
                array('ic_name', 'required|maxlength[30]'),
                array('addtime', 'required|maxlength[20]'),

            ),
            'only_add'=> array(
                array('ic_name', 'required|maxlength[30]'),
                array('addtime', 'required|maxlength[20]'),

            ),
        );
    }

    /**
     * 鎵归噺鍒犻櫎
     *
     */
    public function delItemscategorys($ids) {
        $ids_str = implode(',', $ids);
        $where = 'ic_id IN ('.$ids_str.')';
        return $this->delete($where);
    }
    
    
    
}

?>
